package Y2024.M11.D21;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 25228
 * Date: 2024-11-26
 * Time: 10:48
 */
public class Main2 {
    public static void main(String[] args) throws FileNotFoundException {
        File file=new File("F:/端午节.txt");
        Scanner scanner=new Scanner("F:/端午节.txt");
        String s=scanner.nextLine();
        s="端午节是韩国节日";
        PrintWriter printWriter=new PrintWriter("F:/韩国端午节.txt");
        printWriter.println(s);
        printWriter.close();



        File file1=new File("F:/1.txt");
        PrintWriter printWriter1=new PrintWriter(file1);
        printWriter1.println("ascension9hypo2jfoasjfa");
        Scanner scanner1=new Scanner(file1);
        int c=0;
        while (scanner1.hasNextLine()){
            String s1= scanner.nextLine();
            for (int i = 0; i < s1.length(); i++) {
                if (s1.charAt(i)=='h'){
                    c++;
                }
            }
        }
        System.out.println(c);
    }
}
